//
//  BaseNavViewController.m
//  ZoneTry
//
//  Created by youminuo on 16/7/2.
//  Copyright © 2016年 ZoneTry. All rights reserved.
//

#import "BaseNavViewController.h"

@interface BaseNavViewController ()<UIGestureRecognizerDelegate>

@end

@implementation BaseNavViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // 将导航栏设置为透明
    self.navigationBar.translucent = YES;
    // 设置导航栏背景颜色
    [self.navigationBar lt_setBackgroundColor:kNavBackgroundColor];
//    // 设置导航栏阴影
//    self.navigationBar.shadowImage = [UIImage imageNamed:@"shadow"];
    
    // 设置手势返回代理对象
    __weak typeof (self) weakSelf = self;
    if ([self respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        self.interactivePopGestureRecognizer.delegate = weakSelf;
    }
    
    // Do any additional setup after loading the view.
}

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
    return self.isCanSideBack;
}

- (void)dealloc
{
    // 释放手势返回代理对象
    if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        self.interactivePopGestureRecognizer.delegate = nil;
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
